Stored Procedures [dbo].[dt_getobjwithprop_u]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@propertyvarchar(30)30
@uvaluenvarchar(255)510
Permissions
TypeActionOwning Principal
GrantExecutepublic
SQL Script
/*
**    Retrieve the owner object(s) of a given property
*/

create procedure dbo.dt_getobjwithprop_u
    @property varchar(30),
    @uvalue nvarchar(255)
as
    set nocount on

    if (@property is null) or (@property = '')
    begin
        raiserror('Must specify a property name.',-1,-1)
        return (1)
    end

    if (@uvalue is null)
        select objectid id from dbo.dtproperties
            where property=@property

    else
        select objectid id from dbo.dtproperties
            where property=@property and uvalue=@uvalue
GO
GRANT EXECUTE ON  [dbo].[dt_getobjwithprop_u] TO [public]
GO
Uses